package com.gateway.uti;

import org.springframework.stereotype.Component;

/**
 * @author Elias
 * @version 1.0
 * @date 2021-06-16 14:03
 * @description
 * @copyright 2021
 */
@Component
public class WebUtils {
    /**
     * 移除url中多余的斜杠
     * @param url url
     * @return 移除后的结果
     */
    public static String removeExtraSlashOfUrl(String url){
        if (url == null || url.length() == 0){
            return url;
        }
        return url.replace("(?<!(http:|https:))/+", "/");
    }
}
